package com.matt.service.impl;

import com.matt.domain.ProductWarn;
import com.matt.repository.ProductWarnRepository;
import com.matt.service.ProductWarnService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2018/12/11
 * *******************************
 */
@Slf4j
@Service
public class ProductWarnServiceImpl implements ProductWarnService {

    @Autowired
    private ProductWarnRepository productWarnRepository;

    @Override
    public ProductWarn getWarn(String areaTypeId, String productId) {
        if (StringUtils.isNotBlank(areaTypeId)) {
            return productWarnRepository.findByProductIdAndAreaTypeId(productId, areaTypeId);
        }
        return null;
    }
}
